This invention relates to a method and apparatus for quantising and dequantising data, especially, although not exclusively, images that are compressed, for example, using a wavelet transform.
In a typical transform-based image compression system, an input image is first decomposed by a transform to provide transform coefficient data, which data is then quantised and then coded for onward transmission. One transform used in such a system is the wavelet transform. The transmitted data is then dequantised and reconstructed into the original image.
The most popularly used quantisers in image compression systems work in one of two ways. A first type of quantiser is the uniform quantiser which achieves quantisation using step sizes to quantise the image data in either integer or floating point form. The second type is a bit plane quantiser, which uses thresholds to correlate each bit of the image data to become either xe2x80x9c1xe2x80x9d or xe2x80x9c0xe2x80x9d. Currently, the two different types of quantisation systems cannot work with each other. That is, a uniform quantiser can only operate with its corresponding uniform dequantiser and a bit plane quantiser can only work with its corresponding bit plane dequantiser. Thus, a decompression system having a particular type of dequantiser cannot decompress data from any compression system, but only from one having the corresponding type of quantiser. Similarly, the coder, which codes the quantised data for onward transmission must be of the correct type to work with the particular type of quantiser.
The present invention therefore seeks to provide a method and apparatus for quantising and dequantising data which overcomes, or at least reduces the above-mentioned problems of the prior art.
Accordingly, in a first aspect, the invention provides a method of quantising data in a data compression system, the method comprising the steps of:
(a) receiving original data in the form of a plurality of discrete data values;
(b) providing a plurality of quantisation techniques in the data compression system;
(c) selecting at least one of the plurality of quantisation techniques for quantising the received data;
(d) quantising the received data using the selected quantisation technique to produce quantised data; and
(e) outputting the quantised data.
Preferably, the plurality of quantisation techniques includes at least a first quantisation technique and a second quantisation technique.
In a preferred embodiment step (d) comprises using the first quantisation technique to produce first quantised data and using the second quantisation technique to produce second quantised data from the first quantised data.
Preferably the first quantisation technique comprises a bitplane quantisation technique, which most preferably comprises the steps of:
(d1) determining a current bit plane corresponding to the received original data by quantising each of the discrete data values for a current quantisation level according to whether the discrete data value is above or below a current predetermined threshold to provide a plurality of current quantised values corresponding to the plurality of discrete data values;
(d2) determining the polarity of any quantised value in the bit plane which has become 1 for the first time;
(d3) updating the discrete data values utilising the current predetermined threshold to produce a plurality of updated discrete data values;
(d4) updating the predetermined threshold according to a predetermined rule;
(d5) repeating steps (d1) to (d4) for the updated discrete data values for subsequent levels of quantisation; and
(d6) terminating the repetition step (d5) when quantisation for a required number of quantisation levels has been carried out.
Preferably, the second quantisation technique comprises a uniform quantisation technique, which most preferably comprises the step of:
(d7) determining a current integer plane corresponding to the current bit plane determined in step (d1), the current integer plane being formed of a plurality of current integer values, each of which is generated from the corresponding current quantised value and its polarity for the current and any previous quantisation levels;
wherein the second quantised data is formed by the current integer plane and information including the current level of quantisation.
In a preferred embodiment, the information including the current level of quantisation comprises a most recently updated predetermined threshold.
Preferably, the method further comprises a first step of receiving input data and level shifting the received input data to provide the discrete data values.
According to a second aspect, the invention provides apparatus for quantising data in a data compression system, the apparatus comprising:
an input for receiving original data in the form of a plurality of original discrete data values;
a first quantisation module coupled to the input for quantising the discrete data values using a first quantisation technique to produce first quantised data at an output thereof;
a second quantisation module selectively coupled to the input for quantising the discrete data values using a second quantisation technique to produce second quantised data at an output thereof;
a selector coupled to the outputs of the first and second quantisation modules for selecting at least one of the first and second quantised data at an output thereof.
According to a third aspect, the invention provides apparatus for quantising data in a data compression system, the apparatus comprising:
an input to receive original data in the form of a plurality of original discrete data values;
a first quantisation module coupled to the input and having an output to provide first quantised data;
a second quantisation module selectively coupled to the input and having an output to provide second quantised data;
a selector having inputs coupled to the outputs of the first and second quantisation modules and having an output.
In a preferred embodiment, the second quantisation module is selectively coupled to the output of the first quantisation module. The first quantisation module preferably comprises a bitplane quantisation module. The second quantisation module preferably comprises a uniform quantisation module.
In a fourth aspect, the invention provides a method of dequantising quantised data in a data decompression system, the method comprising the steps of:
(a) receiving quantised data;
(b) providing a plurality of dequantisation techniques in the data decompression system;
(c) selecting at least one of the plurality of dequantising techniques for dequantising the received quantised data;
(d) dequantising the received quantised data using the selected dequantising technique to produce dequantised data; and
(e) outputting the dequantised data.
In a preferred embodiment, the plurality of dequantisation techniques includes at least a first dequantisation technique and a second dequantisation technique.
The first dequantisation technique preferably comprises a bitplane dequantisation technique. The second dequantisation technique preferably comprises a uniform dequantisation technique.
Preferably, step (d) comprises using a quantisation technique to produce further quantised data and using the second dequantisation technique to produce dequantised data from the further quantised data.
Preferably, the quantised data has been quantised using a bitplane technique, the quantisation technique is a uniform quantisation technique and the second dequantisation technique comprises a uniform dequantisation technique.
The quantisation technique preferably comprises the step of:
determining current integer values corresponding to bitplane values received as the quantised data, a current integer value being generated from the corresponding current bitplane value and its polarity for the current and any previous quantisation levels;
wherein the further quantised data is formed by the current integer values.